{% extends 'base.html' %}
{% load staticfiles %}

{% block site_title %} 答题页面| PyWordTest By J.Sky {% endblock %}

{% block page %}

    <script type="text/javascript">
        function beforeSubmit(form) {
            if (form.answer.value == '') {
                alert('单词不能为空，一个填写单词！！');
                form.answer.focus();
                return false;
            }

            return true;
        }
    </script>
    <main class="container theme-showcase" role="main">


        <div class="container bs-example">
            <form class="form-horizontal" name="form" action="{% url isend %}" onSubmit="return beforeSubmit(this);">

                <div class="form-group group-lg">
                    <div class="col-sm-offset-2 col-sm-10">
                        <h1 class="jumbotron-heading">{{ s.1 }}</h1>
                    </div>
                </div>


                <div class="form-group">
                    <h3 for="answer" class="col-sm-2 control-label">English:</h3>
                    <div class="col-sm-10">

                        <textarea class="apptextarea form-control " rows="3" name="answer"
                                  autofocus="autofocus"></textarea>
                    </div>
                </div>


                <input type="hidden" name="p" value="{{ request.session.p }}">

                <div class="form-group group-lg">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">{{ btn }}</button>
                    </div>
                </div>


            </form>
            {#            <h3 class="col-sm-offset-2 col-sm-10">考试进度：{{ request.session.p }}/{{ request.session.qb|length }}</h3>#}
            <div class="progress">
                <div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar"
                     aria-valuenow="{{ progress }}" aria-valuemin="0" aria-valuemax="100"
                     style="width: {{ progress }}%">
                    考试进度：{{ request.session.p }}/{{ request.session.qb|length }}
                </div>
            </div>


        </div>


        {#    {{ p|add:1 }}<br/>#}


    </main>



    <script language="javascript">
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });


    </script>







{% endblock %}